//
// Created by 刘禹晨 on 5/18/16.
// Copyright (c) 2016 刘禹晨. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

#define UUIDReadCharacteristic @"FFE1"
#define UUIDWriteCharacteristic @"FFE1"
#define BLENAME @"<SHUNLAN1>"

typedef enum{
    KNOT = 0,
    KING = 1,
    KSUCCESS = 2,
    KFAILED = 3,
}myStatus;

@protocol BLEManagerDelegate
@optional
-(void)didStopScan;
-(void)didFoundPeripheral;
-(void)didReadvalue;
-(void)didConnected;
@required
-(void)didDisconnect;


@end
@interface BLEManager : NSObject
+ (BLEManager *)instance;
-(void)BLEDisconnect;
-(void)scan;

@property (weak, nonatomic) id<BLEManagerDelegate> delegate;
@property (strong, nonatomic) NSMutableArray *dicoveredPeripherals;
@property (strong, nonatomic) CBPeripheral *currentPeripheral;
@property (strong, nonatomic) NSMutableArray *services;
@property (strong, nonatomic) NSMutableData *recvMsgData;
@property (strong, nonatomic) NSMutableData *resultData;
@property (strong, nonatomic) CBCharacteristic *cbCharacteristic;


-(void)setup;

@end